<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/hpp_c1_c2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<title>Endorse First Level Planning</title>

<link id="screenBaseCss" rel="stylesheet" type="text/css" href="<s:url value="/css/screen.css"/>"/>
<script src="<s:url value="/js/ejs/Grid/GridE.js"/>" type="text/javascript"> </script>
<link href="<s:url value="/js/ejs/Styles/vtc.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="/css/vtc_screen.css"/>" rel="stylesheet" type="text/css" />
<link id="coreBaseCss" rel="stylesheet" type="text/css" href="<s:url value="/css/core.css"/>"/>
<script language="javascript1.5" type="text/javascript" src="<s:url value="/js/config.js"/>" ></script>
<script language="javascript1.5" type="text/javascript" src="<s:url value="/js/core.js"/>" ></script>
<script language="javascript1.5" type="text/javascript" src="<s:url value="/js/popup.js"/>" ></script>

<style>
.oddRowBgColor {
	background-color:#FF0 !important;
}

</style>

<script type="text/javascript">
	
	function preview(){
		Grids['SelectionGrid'].Save();
	}
	
	var level1Start =<s:property value="category.level1Start"/>;
	var level1End =<s:property value="category.level1End"/>;
	
	function showOrHide(thisObj){
		var value = thisObj.value;
		var G=  Grids['PreviewGrid'];
		
		if(value.indexOf("Training")!=-1){
			if(value.indexOf("Show")!=-1){
				for(var i=level1Start;i<=level1End;i++){
					G.ShowCol("_"+i+"_"+(i+1)+"_HOURS");
				}
				thisObj.value = 'Hide Planned Training Hours';	
				
			}else{
				for(var i=level1Start;i<=level1End;i++){
					G.HideCol("_"+i+"_"+(i+1)+"_HOURS");
				}
				
				thisObj.value = 'Show Planned Training Hours';
			}
			
		}else{
			if(value.indexOf("Show")!=-1){
				for(var i=level1Start;i<=level1End;i++){
					G.ShowCol("_"+i+"_"+(i+1)+"_FACTOR");
				}
				thisObj.value = 'Hide Conversion Factor';	
				
			}else{
				for(var i=level1Start;i<=level1End;i++){
					G.HideCol("_"+i+"_"+(i+1)+"_FACTOR");
				}
				thisObj.value = 'Show Conversion Factor';
			}
			
		}
	}	
	
	function toDisView(level1PlanningId,categoryNodeId){
		window.location = "<s:url value='/planfirst'/>/discipline-planning-item.action?no-decorate&level1PlanningId="+level1PlanningId+"&categoryNodeId="+categoryNodeId
						 +"&operator=PLANNER&planningId=<s:property value='planningId'/>";
	}
	

</script>

</head>

<body scroll="no" style="overflow:hidden">
<div class="body" style="height:100%;">

  <table style="height:100%; width:100%" border="0" cellpadding="0" cellspacing="0" >
    <tr>
      <td style="height:58px; background:#F00" ><div class="button-region-style">
			<div class="btnSet">
	            <table width="95%" cellspacing="0" cellpadding="0">
	              <tbody><tr>
	                <td><div class="left">
	                
	                 <s:if test="planningStatus!='Endorsed'">
	                <security:authorize access="hasRole('ENDORSE_1ST_LEVEL')">
	                    <div class="button">
	                      <div class="left">
	                        <div class="right">
	                          <input type="button" onclick="window.location='preview-level-one-planning!endorse.action?no-decorate&planningId=<s:property value='planningId'/>'" value="Endorse" name="" id="" class="inputButton">
	                        </div>
	                      </div>
	                    </div>
	                    </security:authorize>
	                    <div class="button">
	                      <div class="left">
	                        <div class="right">
	                          <input type="button" onclick="Grids['Level2Planning'].Save();searchByInService()" value="Reject Selected Node" name="" id="" class="inputButton">
	                        </div>
	                      </div>
	                    </div>
	                    
	                  </s:if>
	                    
	                    <div class="button">
	                      <div class="left">
	                        <div class="right">
	                          <input type="button" onclick="window.location='select-first-level-to-endorse.action?no-decorate&planningId=<s:property value='planningId'/>'" value="Cancel" name="" id="" class="inputButton">
	                        </div>
	                      </div>
	                    </div>
	                    <div class="button" >
	                      <div class="left" >
	                        <div class="right" >
	                          <input class="inputButton" type="button" id="" name="" value="Hide Conversion Factor" onClick="showOrHide(this)" />
	                        </div>
	                      </div>
	                    </div>
	                    <div class="button" >
	                      <div class="left" >
	                        <div class="right" >
	                          <input class="inputButton" type="button" id="" name="" value="Hide Planned Training Hours" onClick="showOrHide(this)" />
	                        </div>
	                      </div>
	                    </div>
	                    <div class="button">
	                      <div class="left">
	                        <div class="right">
	                          <input type="button" onclick="_archive(event)" value="Archive" name="" id="" class="inputButton">
	                        </div>
	                      </div>
	                    </div>
	                  </div>
	                  </td>
	                  <td style="text-align:right">
		                  <div class="left">
		                    <div class="button">
		                      <div class="left">
		                        <div class="right">
		                          <input type="button" value="Generate Summary" name="" id="" class="inputButton">
		                        </div>
		                      </div>
		                    </div>
		                  </div>
	                  </td>
	                  <td>
	                    <label style="color:#FFF">
	                      <input type="checkbox" name="" id="" class="inputCheckbox">
	                      		Include Selected Node Header 
	                     </label>
	                  </td>
	              </tr>
	            </tbody>
	          </table>
          </div>
          
        </div>
        <div class="title-region-style">1st Level Planning - Endorsement</div></td>
    </tr>
    <tr>
      <td style="vertical-align:top"><input type="hidden" name="grid" id="GridData">
        <div style="width:100%;height:100%">
          <bdo Debug='0' 
               Data_Url="preview-level-one-planning!data.action?no-decorate&planningId=<s:property value='planningId'/>"
               Upload_Url="preview-level-one-planning!saveData.action?no-decorate&planningId=<s:property value='planningId'/>" Upload_Format="Internal" Upload_Data="treeGridData">
          </bdo>
        </div></td>
    </tr>
  </table>
  
</div>
</body>
</html>